
def escape(x, y, m):
    if (m == 1 or m == 2) and (x != m and y != m):
        return 1

    if m == x or m == y:
        return 0

    return escape(x, y, m - 1) + escape(x, y, m - 2)

arguments = input() # 字符串："2,4,7"
arguments = arguments.split(',') # ["2", "4", "7"]
arguments = [int(c) for c in arguments] # [2,4,7]

print(escape(arguments[0], arguments[1], arguments[2]))
